<template>
  <div class="xiecheng">
    <div class="admin_main_block">
      <div class="admin_main_block_top">
        <div class="admin_main_block_right">
          <div>
            <el-button icon="Back" @click="router.push({ name: 'module_business_share_list_category_list' })">
              {{ $t('common.return') }}
            </el-button>
          </div>
        </div>
      </div>

      <div class="admin_table_main">
        <el-tabs v-model="activeName" type="border-card">
          <el-tab-pane v-if="type == 0 || (id != 0 && type == 1) " name="1" :label="$t('share.product_info')" :lazy="true">
            <product/>
          </el-tab-pane>
          <el-tab-pane v-if="type == 0 || (id != 0 && type == 2) " name="2" :label="$t('share.example_info')" :lazy="true">
            <example/>
          </el-tab-pane>
          <el-tab-pane v-if="type == 0 || (id != 0 && type == 3) " name="3" :label="$t('share.place_info')" :lazy="true">
            <place/>
          </el-tab-pane>
          <el-tab-pane v-if="type == 0 || (id != 0 && type == 4) " name="4" :label="$t('share.teacher_info')" :lazy="true">
            <teacher/>
          </el-tab-pane>
          <el-tab-pane v-if="type == 0 || (id != 0 && type == 5) " name="5" :label="$t('share.supplier_info')" :lazy="true">
            <supplier/>
          </el-tab-pane>
        </el-tabs>
      </div>
    </div>
  </div>
</template>

<script setup name="share-list-list">
  import { useBase } from "@/hooks/base/useBase"

  import Place from '@/components/business/share/place'
  import Example from '@/components/business/share/example'
  import Product from '@/components/business/share/product'
  import Teacher from '@/components/business/share/teacher'
  import Supplier from '@/components/business/share/supplier'

  const { router, query, i18n } = useBase()

  const id = ref(0)
  const type = ref(0)
  const activeName = ref('1')
  const model = ref('business/share')

  onMounted(() => {
    id.value = query.id || 0
    type.value = query.type || 0
    activeName.value = query.type ? query.type + '' : '1'
  })
</script>
